package cn.sunline.test.api.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import cn.sunline.test.api.service.RegisterService;
import cn.sunline.test.api.service.remote.UserService;

@RequestMapping("/register")
@RestController
public class RegisterController {
	@Autowired
	UserService userService;
	@Autowired
	RegisterService registerService;
	
	@GetMapping("/hello/{name}")
    public String index(@PathVariable("name") String name) {
        return userService.hello(name);
    }
	
	@GetMapping("/{name}/{email}")
    public String register(@PathVariable("name") String name,@PathVariable("email") String email) {
        return registerService.register(name, email);
    }
}
